package com.cskaoyan.mapper;

import com.cskaoyan.bean.Permission;
import com.cskaoyan.bean.PermissionExample;
import java.util.List;
import org.apache.ibatis.annotations.Param;

public interface PermissionMapper {
    long countByExample(PermissionExample example);

    int deleteByExample(PermissionExample example);

    int deleteByPrimaryKey(Integer id);

    int insert(Permission record);

    int insertSelective(Permission record);

    List<Permission> selectByExample(PermissionExample example);

    Permission selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") Permission record, @Param("example") PermissionExample example);

    int updateByExample(@Param("record") Permission record, @Param("example") PermissionExample example);

    int updateByPrimaryKeySelective(Permission record);

    int updateByPrimaryKey(Permission record);

    // 根据一组roleId获取一组权限
    List<String> queryPermsByRoleIds(List<Integer> roleIds);

    // 根据单个roleId获取一组权限
    List<String> selectPermsByRoleId(Integer roleId);

    // 批量插入权限
    void insertPermsByRoleId(@Param("roleId") Integer roleId, @Param("perms") List<String> permissions);

}